/*
Ethereal Farm
Copyright (C) 2020  Lode Vandevenne

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

/*
The generic medal images are for when no specific icon for it exists. The
generic ones come in tiers of better and better metals for higher level
medals.

The materials in increasing level are:

-0: zinc: dark gray
-1: bronze: brown
-2: silver: medium gray
-3: electrum: yellow-green
-4: gold: yellow
-5: platinum: light gray
-6: rhodium: rose
-7: sapphire: blue
-8: emerald: green
-9: ruby: red
-10: diamond: white
*/

// These tiers are also used for other things than medals, e.g. fruits and some of the tree images
var tierNames =     ['zinc', 'bronze', 'silver', 'electrum', 'gold', 'platinum', 'rhodium', 'sapphire', 'emerald', 'ruby', 'diamond'];
var tierColors =    ['#444',   '#840',   '#888',     '#bf6', '#ff0',     '#ddd',    '#fdd',     '#00f',    '#0c4', '#f00',    '#fff'];
var tierColors_BG = ['#000',   '#420',   '#666',     '#8a4', '#bb0',     '#aaa',    '#a88',     '#00a',    '#092', '#a00',    '#eee'];


// medals, too, get more saturation
var medalimageheader = '#l0:#c22 l1:#d44 l2:#e66 l3:#f88';
var hiddenmedalimageheader = '#l0:#8558 l1:#a778 l2:#c998 l3:#fcc8';

var medalheader0 = ' hm:#999';
var medalheader1 = ' hm:#c70';
var medalheader2 = ' hm:#fff';
var medalheader3 = ' hm:#dfb';
var medalheader4 = ' hm:#ff0';
var medalheader5 = ' N:#fff M:#eee m:#ddd n:#ccc';
var medalheader6 = ' N:#fee M:#ecc m:#dbb n:#caa';
var medalheader7 = ' hm:#00f';
var medalheader8 = ' hm:#0f0';
var medalheader9 = ' hm:#f00';
var medalheader10 = ' N:#fff M:#eee m:#ddd n:#ccc';


var medalgenericmetal = `
................
......rrr.......
.....R...r......
.....R...r......
......R.r.......
......R.r.......
.......R........
.......R........
......NNN.......
.....NMMMN......
....NMMMmmn.....
....NMMmmmn.....
....NMmmmmn.....
.....Nmmmn......
......nnn.......
................
`;

var medalgenericgem = `
................
......ggg.......
.....G...g......
.....G...g......
......G.g.......
......G.g.......
.......G........
.......G........
......ZZZ.......
.....ZZNZZ......
....ZZNNmYY.....
....ZNNMmmY.....
....ZZmnnYY.....
.....ZYnYY......
......YYY.......
................
`;




var medalgeneric = [
generateImageCanvas(medalimageheader + medalheader0 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader1 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader2 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader3 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader4 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader5 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader6 + medalgenericmetal),
generateImageCanvas(medalimageheader + medalheader7 + medalgenericgem),
generateImageCanvas(medalimageheader + medalheader8 + medalgenericgem),
generateImageCanvas(medalimageheader + medalheader9 + medalgenericgem),
generateImageCanvas(medalimageheader + medalheader10 + medalgenericgem),
];

var medalhiddenmetal = `
................
................
................
................
.......mm.......
......m..m......
......m..m......
........m.......
........m.......
................
........m.......
................
................
................
................
................
`;

var medalhiddengem = `
................
................
................
................
.......YY.......
......Y..Y......
......Y..Y......
........Y.......
........Y.......
................
........m.......
................
................
................
................
................
`;

var medalhidden = [
generateImageCanvas(hiddenmedalimageheader + medalheader0 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader1 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader2 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader3 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader4 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader5 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader6 + medalhiddenmetal),
generateImageCanvas(hiddenmedalimageheader + medalheader7 + medalhiddengem),
generateImageCanvas(hiddenmedalimageheader + medalheader8 + medalhiddengem),
generateImageCanvas(hiddenmedalimageheader + medalheader9 + medalhiddengem),
generateImageCanvas(hiddenmedalimageheader + medalheader10 + medalhiddengem),
];


var image_medaltranscend = generateImageCanvas(`
................
................
.ZZZZZZZZZZZZZZ.
.ZXXXXXXXXXXXrZ.
.ZXOOOOOOOOOOrZ.
.ZXOOOOOOOOOOrZ.
.ZXrrrrOOrrrrrZ.
.ZZZZZXOOrZZZZZ.
.....ZXOOrZ.....
.....ZXOOrZ.....
.....ZXOOrZ.....
.....ZXOOrZ.....
.....ZXOOrZ.....
.....ZrrrrZ.....
.....ZZZZZZ.....
................
`);

